package com.ydd.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.pagehelper.Page;
import com.ydd.entity.YddArticle;
import com.ydd.vo.HotArticleVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author itcast
 * @since 2023-05-15
 */
public interface YddArticleMapper extends BaseMapper<YddArticle> {

    List<HotArticleVO> getHotArticleList();

    @Select("SELECT COUNT(*)  FROM ydd_article  ya  WHERE  ya.status=2 and ya.cateid=#{cateid}")
    Integer countByCatename(Integer cateid);

    Page<YddArticle> searchAll();
}
